package com.easy.common.bean;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import lombok.Data;

/**
 * 总订单表
 * @TableName order_master
 */
@TableName(value ="order_master")
@Data
public class OrderMaster implements Serializable {
    /**
     * 总订单ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 订单编号（唯一）
     */
    @TableField(value = "order_no")
    private String orderNo;

    /**
     * 用户ID
     */
    @TableField(value = "user_id")
    private Integer userId;

    /**
     * 订单总金额（单位：元）
     */
    @TableField(value = "total_amount")
    private BigDecimal totalAmount;

    /**
     * 实付金额（单位：元）
     */
    @TableField(value = "pay_amount")
    private BigDecimal payAmount;

    /**
     * 优惠金额（单位：元）
     */
    @TableField(value = "discount_amount")
    private BigDecimal discountAmount;

    /**
     * 订单状态（0-待支付，1-已支付，2-已取消，3-已完成）
     */
    @TableField(value = "status")
    private Integer status;

    /**
     * 支付时间
     */
    @TableField(value = "pay_time")
    private LocalDateTime payTime;

    /**
     * 取消时间
     */
    @TableField(value = "cancel_time")
    private LocalDateTime cancelTime;

    /**
     * 完成时间
     */
    @TableField(value = "finish_time")
    private LocalDateTime finishTime;

    /**
     * 收货人姓名
     */
    @TableField(value = "receive_name")
    private String receiveName;

    /**
     * 收货人电话
     */
    @TableField(value = "receive_phone")
    private String receivePhone;

    /**
     * 收货地址
     */
    @TableField(value = "receive_address")
    private String receiveAddress;

    /**
     * 创建时间
     */
    @TableField(value = "create_time")
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @TableField(value = "update_time")
    private LocalDateTime updateTime;

    @TableField(value = "isdel")
    @TableLogic
    private Integer isdel;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;


}